import { createRouter, createWebHashHistory } from 'vue-router'

const router = createRouter({
  history: createWebHashHistory(),
  routes: [
    {
      path: '/',
      redirect: '/login'
    },
    {
      path: '/login',
      name: 'login',
      component: ()=> import('@/views/Login.vue'),
    },
    {
      path: '/register',
      name: 'register',
      component: ()=> import('@/views/Register.vue'),
    },
    // {
    //   path: '/homeview',
    //   redirect:'/homeview'
    // },
    {
      path: '/homeview',
      name: 'homeview',
      component: ()=> import('@/views/HomeView.vue'),
      children:[
        //产品介绍
        
        {
          path:'dashboard',
          component: ()=>import('@/views/IntroductionView.vue')
        },
        //监控管理
        {
          path:'timeMonitoring',
          component: ()=>import('../views/MonitoringManagement/TimeMonitoringView.vue')
        },
        {
          path:'warehouseMonitoring',
          component: ()=>import('../views/MonitoringManagement/WarehouseMonitoringView.vue')
        },

        //报警管理
        {
          path:'alarmConfiguration',
          component: ()=>import('../views/AlarmManagement/AlarmConfigurationView.vue')
        },
        {
          path:'timeAlarm',
          component: ()=>import('../views/AlarmManagement/TimeAlarmiew.vue')
        },
        {
          path:'alarmRecord',
          component: ()=>import('../views/AlarmManagement/AlarmRecordView.vue')
        },
      
        //统计报表
        {
          path:'statisticalReport',
          component: ()=>import('@/views/StatisticalReportView.vue')
        },
        //历史记录
        {
          path:'warehouseAlarmRecords',
          component: ()=>import('../views/HistoryRecordView/WarehouseAlarmRecordsView.vue')
        },
        {
          path:'warehouseHistoryRecords',
          component: ()=>import('../views/HistoryRecordView/WarehouseHistoryRecordsView.vue')
        },

        {
          path:'businessManagement',
          component: ()=>import('../views/SystemManagement/BusinessManagementView.vue')
        },
        {
          path:'warehouseManagement',
          component: ()=>import('../views/SystemManagement/WarehouseManagementView.vue')
        },
        {
          path:'hostManagement',
          component: ()=>import('../views/SystemManagement/HostManagementView.vue')
        },
        {
          path:'instrumentManagement',
          component: ()=>import('../views/SystemManagement/InstrumentManagementView.vue')
        }
      ]
    }

  ],
})

export default router
